package com.pkk.penguin.frame.know.boot.constand;

import java.util.Arrays;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @description: 配置常量类
 * @author: peikunkun
 * @create: 2020-05-20 19:04
 **/
public class ConfigConstand {


  @Getter
  @AllArgsConstructor
  public enum RequestType {

    /**
     * post请求
     */
    POST(1),

    /**
     * get请求
     */
    GET(2);

    private Integer type;


    public static RequestType get(Integer type) {
      return Arrays.stream(RequestType.values()).filter(a -> a.getType().equals(type)).findFirst()
          .orElseThrow(IllegalStateException::new);
    }


  }

}
